﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using XMK.Framework.DataAccess;
using XMK.Framework.Config;
using XMK.Utils;

namespace XMK.Tadong.DataSearch.Biz
{
    public class DataSearchConfig
    {
        public static readonly string ESHost;
        public static readonly int Port;
        public static readonly string IndexName;

        public static readonly string XMKFileIndexPath;
        public static readonly string TeamFileIndexPath;

        public static readonly DbProvider TadongDbProvider;

        static DataSearchConfig()
        {
            //推荐使用根据Web.Config中的connectionStrings配置节的name获取数据库实现
            ESHost = XMK.Utils.ConfigHelper.GetAppSettingValue("eshost", "localhost");
            Port = ParseHelper.Parse<int>(XMK.Utils.ConfigHelper.GetAppSettingValue("port", "9500"));
            IndexName = XMK.Utils.ConfigHelper.GetAppSettingValue("xmkindexname", "xmkfileindex");

            XMKFileIndexPath = XMK.Utils.ConfigHelper.GetAppSettingValue("xmkfileindexPath", @"d:\tadong\xmkfileindex");
            TeamFileIndexPath = XMK.Utils.ConfigHelper.GetAppSettingValue("teamfileindexPath", @"d:\tadong\teamfileindex");

            TadongDbProvider = XMK.Framework.Config.ConfigHelper.GetDbProvider("TadongDbConn");
        }
    }
}
